# -*- coding:utf-8 -*-
# @Author:🎈RedBalloon
# @Time:2022/10/2-18:01
# @File:wallpaper.py
import requests
import json
import pprint
url = "https://pcwallpaper.upupoo.com/wallpaper/lists"
headers = {
    "Host": "pcwallpaper.upupoo.com",
    "Connection": "keep-alive",
    # 动态的
    "Content-Length": "89",
    "Origin": "https://pc.upupoo.com",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) upupoo-wallpaper-shop/0.0.1 Chrome/80.0.3987.165 Electron/8.2.5 Safari/537.36",
    "Content-Type": "application/json",
    "Accept": "application/json, text/plain, */*",
    "Sec-Fetch-Dest": "empty",
    "port": "9110",
    "token": "undefined",
    "Sec-Fetch-Site": "same-site",
    "Sec-Fetch-Mode": "cors",
    "Referer": "https://pc.upupoo.com/findwallpaper_v17/mi_pc.html",
    "Accept-Encoding": "gzip, deflate, br",
    "Accept-Language": "zh-CN",
    "Cookie": "UM_distinctid=18363e6694034-013cd55fb740 91-31070b63-144000-18363e669413cb"
}
# 标签ID: https://pcwallpaper.upupoo.com/wallpaper/getTags
# size: 控制显示多少个
datas = {"current":1,"size":28,"total":"175588","type":0,"tagId":0,"sort":0,"resolution":0,"hairtail":0}
# datas = {"current":1,"size":28,"total":"16117","type":0,"tagId":12,"sort":0,"resolution":0,"hairtail":0}

response = requests.post(url, headers=headers, json=datas, timeout=3)
# print(response.text)
json_data = json.loads(response.text)
pprint.pprint(json_data)



# url = ""